package com.bs.web.rest;


import com.bs.domain.ServiceInfo;
import com.bs.service.QuestionCountService;
import com.bs.service.TransferCountService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value = "transferCount")
@RestController
@RequestMapping("/api/dashboard")
public class TransferCountResource {

    @Autowired
    TransferCountService transferCountService;


    @GetMapping("/callServiceTop10")
    public List<ServiceInfo> callServiceTop10Resource(
        @RequestParam("partition") String partition,
        @RequestParam("logmsg") String logmsg,
        @RequestParam("startTime") String startTime,
        @RequestParam("endTime") String endTime,
        @RequestParam("code") String code,
        @RequestParam("active") String active
    ) {
        List<ServiceInfo> serviceInfos = transferCountService.callServiceTop10(partition, logmsg, startTime, endTime, code, active);
        return serviceInfos;
    }

    @GetMapping("/batchServiceTop10")
    public List<ServiceInfo> batchServiceTop10Resource(
        @RequestParam("partition") String partition,

        @RequestParam("startTime") String startTime,
        @RequestParam("endTime") String endTime,
        @RequestParam("code") String code,
        @RequestParam("active") String active
    ) {
        List<ServiceInfo> serviceInfos = transferCountService.batchServiceTop10(partition, startTime, endTime, code, active);
        return serviceInfos;
    }

    @GetMapping("/asyncRouteServiceTop10")
    public List<ServiceInfo> asyncRouteServiceTop10Resource(
        @RequestParam("partition") String partition,
        @RequestParam("startTime") String startTime,
        @RequestParam("endTime") String endTime,
        @RequestParam("code") String code,
        @RequestParam("active") String active
    ) {
        List<ServiceInfo> serviceInfos = transferCountService.asyncRouteServiceTop10(partition, startTime, endTime, code, active);
        return serviceInfos;
    }
    @GetMapping("/callFrameServiceTop10")
    public List<ServiceInfo> callFrameServiceTop10Resource(
        @RequestParam("partition") String partition,
        @RequestParam("startTime") String startTime,
        @RequestParam("endTime") String endTime,
        @RequestParam("code") String code,
        @RequestParam("active") String active
    ) {
        List<ServiceInfo> serviceInfos = transferCountService.callFrameServiceTop10(partition,startTime, endTime, code, active);
        return serviceInfos;
    }


    @GetMapping("/uidServiceTop10")
    public List<ServiceInfo> teleServiceTop10Resource(
        @RequestParam("partition") String partition,
        @RequestParam("startTime") String startTime,
        @RequestParam("endTime") String endTime,
        @RequestParam("code") String code,
        @RequestParam("active") String active
    ) {
        List<ServiceInfo> serviceInfos = transferCountService.uidServiceTop10(partition, startTime, endTime, code, active);
        return serviceInfos;
    }




}
